


window.buangParent = Jx.Class.instantiate('Jx.event.Observable');

window.buang = Jx.Class.instantiate('Jx.event.Observable');

buang.event.setBubbleTarget( buangParent );

buang.event.listen({

	'buang': function(evt){

		console.log('buang eventobject ', evt);

	}

});



buangParent.event.listen({

	'buang': function(evt){

		console.log('buangParent eventobject ', evt);

		buangParent.event.unlisten('buang', arguments.callee);

	},

	':defer': 500

});


window.query = Jx.instantiate('Jx.dom.css.Query');



window.trace = function(use, path, returnValue, showLength){

	var startTime = (new Date()).getTime(),

		returned = void(0);

	switch(use){

		case 'Ext':

			returned = Ext.DomQuery.jsSelect(path);

			break;

		case 'Browser':

			returned = document.querySelectorAll(path) || [];

			break;

		default:

			query.trace = false;

			returned = query.select(path, document) || [];

			break;
		
	}

	console.log(use+' runtime: '+( ((new Date()).getTime() - startTime) / 1000 )+' seconds');

	if (showLength){

		console.log('found: ', returned.length );

	}

	return returnValue ?

		returned

		:

		void(0);

}

window.traceJx = function( path ){

	return trace.apply( this, [ 'Jx' ].concat(

		Array.prototype.slice.call( arguments, 0 )

	));

}

window.traceExt = function( path ){

	return trace.apply( this, [ 'Ext' ].concat(

		Array.prototype.slice.call( arguments, 0 )

	));

}

window.traceDefault = function( path ){

	return trace.apply( this, [ 'Browser' ].concat(

		Array.prototype.slice.call( arguments, 0 )

	));

}












//buangFn = function(){
//
//}
